#!./perl # # This script will redirect the client to /channel/day or /channel/night # depending on the time of day (according to the server). # #require "ctime.pl"; # # Play with these variables to meet your needs # $day_path = ""; $night_path = "#night"; $start_day = 7; # Daytime starts at 7 am $start_night = 19; # Nightime starts at 7 pm # # The code starts here # @day = split (' ', `/usr/bin/date` ); #print $day[2]; @today = split (' ', `/usr/bin/time` ); ($hour,$min,$sec) = split(':',$today[3]); if ($hour >= $start_night || $hour < $start_day) { # Ok, we're in nightime $redirpath = $night_path; } else { # It's daytime $redirpath = $day_path; } $file = "day$day[2].html"; print "Content-type: text/html\n\n"; print "
\n"; print "